UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dt4TTgwSveTeMSHLIFBIrNrEMmZC7H7aOXE7k8Tv7qM='
WHERE
key_id = '89659ab4268d71707110723551828bc454091067479bae8439e690bb509ee1b8'
AND (
token = 'dt4TTgwSveTeMSHLIFBIrNrEMmZC7H7aOXE7k8Tv7qM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)