UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3j7lRn2HOm4FcuVAHqR5A/nK8kareBk07BtYv6qYQ0g='
WHERE
key_id = 'abba62e185e4c3822577018b340f1c85da5ee8f4781588336120d62511019f44'
AND (
token = '3j7lRn2HOm4FcuVAHqR5A/nK8kareBk07BtYv6qYQ0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)