UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F4oBtLW1mCvufO9DEH2QK2BLZp3j49aEi4vCZdqHy4U='
WHERE
key_id = '4ceea13818872a8bb85547698ec1b19d7224504ba8886f0f9291bade7cf4daf8'
AND (
token = 'F4oBtLW1mCvufO9DEH2QK2BLZp3j49aEi4vCZdqHy4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)