UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bLnzihsHKbocafXj1IOXF1TYTIe7znxjVGoQgIjqHFA='
WHERE
key_id = '7f752be813a71a4b412f9f90aed935ab1afe0c65101f2c38d4ae355b01316718'
AND (
token = 'bLnzihsHKbocafXj1IOXF1TYTIe7znxjVGoQgIjqHFA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)