UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U5uCp62tNzioCJ2Wly1fc7WDE8t/gZ9226YI4pEygxY=' 
WHERE 
  key_id = '21f29d87a82875983cfc9f1f7b7616cf803d14907cc16f158156222ff6d8177d' 
  AND (
    token = 'U5uCp62tNzioCJ2Wly1fc7WDE8t/gZ9226YI4pEygxY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054