UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1P/nqY5X5+gjl1y1eFPNYmt30zMY+0C4AiO49ntMiD4='
WHERE
key_id = '317dd5a05257228e7745daa71cd0c1421e7c931a10fd3e818ea29ee6a9532776'
AND (
token = '1P/nqY5X5+gjl1y1eFPNYmt30zMY+0C4AiO49ntMiD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)