UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qTj64qVd31EDLiyTNeU2ZeorP1fwL1NTCnt7AkYr5N8='
WHERE
key_id = '26e07080c9f9717495f6b02b5292a067ef91b78d201fe357a4e4c799afcac95e'
AND (
token = 'qTj64qVd31EDLiyTNeU2ZeorP1fwL1NTCnt7AkYr5N8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)