UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xuucbt9iRhfAYf2AGtcXViykZOKphvABlDrOveK7ZlM='
WHERE
key_id = 'c7950ebe08db69952003c2eb3f4c1e3b3788e255665e1cee50700c319b510e35'
AND (
token = 'Xuucbt9iRhfAYf2AGtcXViykZOKphvABlDrOveK7ZlM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)