UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IhLjTeDAE89Qv2ov9o3XZDKW148RSzMJ5wyWmdWl/Aw='
WHERE
key_id = '3850a2925fde7cf7b6d8aa65ba2a898dd36718f302b2561c694d507cee19ee52'
AND (
token = 'IhLjTeDAE89Qv2ov9o3XZDKW148RSzMJ5wyWmdWl/Aw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)