UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NGA4cWRnyrkK7tu1L8Lx3MJTuvyf5o/9dx0tJRFt64o=' 
WHERE 
  key_id = 'de235c015b976004e9cbb98007d33bdfbae28458ef33d0854a8df48b13dcbe2c' 
  AND (
    token = 'NGA4cWRnyrkK7tu1L8Lx3MJTuvyf5o/9dx0tJRFt64o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029