UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oA0YpWIOVezZ2x7dgCC/1H7CrgNhWpnvgKYaKZCuJMQ='
WHERE
key_id = '2fb9856307c346ad6a42224d76d692149249c7db42e5b96dab37a900470c6e6e'
AND (
token = 'oA0YpWIOVezZ2x7dgCC/1H7CrgNhWpnvgKYaKZCuJMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)