UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GxlqlMKrivOYTrT03FasR6VyEVaMXgnrmVUDggVmUHU='
WHERE
key_id = '04ca3cc2b30fbb011aad7995ad951a4648fc4fe59d6968820b3cf417f6378a85'
AND (
token = 'GxlqlMKrivOYTrT03FasR6VyEVaMXgnrmVUDggVmUHU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)