UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YXTTWy4ac/Xc/yP3btM4HSlbQt8lm91xJUJ1c87h4yg='
WHERE
key_id = 'd4919ef4998beeb0d3a055fa3191a5ecb54e1fd198086531d53fb828a7c9f1e6'
AND (
token = 'YXTTWy4ac/Xc/yP3btM4HSlbQt8lm91xJUJ1c87h4yg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)