UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QMeVRGjNzxWBNXN42cnWvGRtEXElrgXVhbH3UL1om2A='
WHERE
key_id = '430a773bae1c996c83dde6133c01237b982a8ebb6e30681238bbec8dceed59f6'
AND (
token = 'QMeVRGjNzxWBNXN42cnWvGRtEXElrgXVhbH3UL1om2A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)