UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HDAxt9pqcL5qmAHwzIOoerV5MkHWaMfcYXu4ca/tAj8='
WHERE
key_id = 'd29382eaf6c8b123add582924d2cc5331d437af052a73adf81a7fdf5cda058bf'
AND (
token = 'HDAxt9pqcL5qmAHwzIOoerV5MkHWaMfcYXu4ca/tAj8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)