UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nH013y3hF1MWIh/X1U/rE3cwSDGmCAnCidlu2MbdGHQ='
WHERE
key_id = 'c397d2ba7e4f671d5219a5fbffbdb028f5c38c63bf021de0c1f2a5557bedecae'
AND (
token = 'nH013y3hF1MWIh/X1U/rE3cwSDGmCAnCidlu2MbdGHQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)