UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tna87GuSHQykMc0HUYdvqzN5/YH4hDoyUHrmwmuD+EM='
WHERE
key_id = '86c72ddc3f6862920af54bad6a1dbbbcedddb576544ae77d30f43bfa0e5ef0ca'
AND (
token = 'tna87GuSHQykMc0HUYdvqzN5/YH4hDoyUHrmwmuD+EM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)