UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3ufrcXrnu5Kjs6asuMDbEbATeG3jfwB6gERKjlJzZBw=' 
WHERE 
  key_id = 'ef4b1fe8fb69093e7d9bfa6d8a47c935f97ae07b6bbdaafc3804af8d6163d341' 
  AND (
    token = '3ufrcXrnu5Kjs6asuMDbEbATeG3jfwB6gERKjlJzZBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032