UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qi8jtI5TJyRhGaIZlj0agnRS9tLjmER/Ye/IggRa6wA='
WHERE
key_id = '54e2d6adced53e649d7d577bfd5b715788960f0ee6951a7e4b7b8ff212ebd2e8'
AND (
token = 'qi8jtI5TJyRhGaIZlj0agnRS9tLjmER/Ye/IggRa6wA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)