UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XqY1dfoEKjBo50vlnZoVIhlsV6gZBdeg2qHprnE/kWw=' 
WHERE 
  key_id = '00904786691b481a99c9db66f408ef5f676e5b07efd0ad9234cbc9e6b97c4e27' 
  AND (
    token = 'XqY1dfoEKjBo50vlnZoVIhlsV6gZBdeg2qHprnE/kWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023