UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tuSiuBDYdXtAbbLJElcRRQIUw49dkQ49RFipoJc4nWg=' 
WHERE 
  key_id = '4f913fa7e8df975d66a211b66b59163c132fce52c8e9797f7c2432eddb34565c' 
  AND (
    token = 'tuSiuBDYdXtAbbLJElcRRQIUw49dkQ49RFipoJc4nWg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047