UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FowjbVM4KPBBH5dUpT3yd8/Os5c4q/fLOz6yrKO+E18=' 
WHERE 
  key_id = 'a38a29ff670d6b5936f3aebd6cd3e7bc106cb4444343d2fb8640e4d420009ea5' 
  AND (
    token = 'FowjbVM4KPBBH5dUpT3yd8/Os5c4q/fLOz6yrKO+E18=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020