UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+kLEb03yeVoisrw5JvhiUcfKqBse+ATT7exr1SpSeVc=' 
WHERE 
  key_id = 'fcf24202931ca65496357fb376f1634d11d98e5211be5560d3470d0231284b69' 
  AND (
    token = '+kLEb03yeVoisrw5JvhiUcfKqBse+ATT7exr1SpSeVc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022