UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n1g4GcdtViwJf/hQByjXFCuE6N12yLQlYunV9PMuByk='
WHERE
key_id = '7e602fd5b3e457516f9b9bdd2009ad03fc8c59d548c153fda58a63a1dcb9e84c'
AND (
token = 'n1g4GcdtViwJf/hQByjXFCuE6N12yLQlYunV9PMuByk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)