UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VhADonRRjzKA0esXR8FZR49h9jY7jHVkVULMNzk+1zA='
WHERE
key_id = 'f800da405c4fd30f4804e68199435e272d0f529eef287c508bfe3b681b86c925'
AND (
token = 'VhADonRRjzKA0esXR8FZR49h9jY7jHVkVULMNzk+1zA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)