UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gFKHpT22wWbtHkjhO5e27V5KEptrDhBZFVRGR8djJRQ='
WHERE
key_id = '26c4731edb44682cf04972613692c6fcc61008227da4ccef0c549e4ee95adcaa'
AND (
token = 'gFKHpT22wWbtHkjhO5e27V5KEptrDhBZFVRGR8djJRQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)