UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'scEElnn3PECLYGFSEnIt92pgwWnnh4Zpomeboh8lb1Y='
WHERE
key_id = '2de8d256beeea5a98fad98e1ae65aefe23c380b02a90a91cd5033e267042008a'
AND (
token = 'scEElnn3PECLYGFSEnIt92pgwWnnh4Zpomeboh8lb1Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)