UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MWiI5qfbf0jeYFLqMouPIK3E3LmFzb1GDxIej5VL7CM=' 
WHERE 
  key_id = 'feb74b5318334f25502c8b3df16bc45b6ef35f10ad7f1dd1374fe84931b6f1ec' 
  AND (
    token = 'MWiI5qfbf0jeYFLqMouPIK3E3LmFzb1GDxIej5VL7CM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039