UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Df0M1pDAErf08935b0mJtIPjDN08ipYEN+IhATXwRM='
WHERE
key_id = '88baee188297b09a1eb7cd5ee83378d8f91e43b4c23ae5324a4a5109f4cf64b7'
AND (
token = '3Df0M1pDAErf08935b0mJtIPjDN08ipYEN+IhATXwRM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)