UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rHuTBeN3n/LuOo4w0hGcFfohWRKr2TnfkK6FPNR0aZU=' 
WHERE 
  key_id = '855b2ef1e32414fcacf274a90e3a1945f6a6bcc769c06f097764841e51cd8b01' 
  AND (
    token = 'rHuTBeN3n/LuOo4w0hGcFfohWRKr2TnfkK6FPNR0aZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026