UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P3Z5c7+oIoGaJXCtcrrQiPRcy1qTA5UtPTTEAn7CIQs=' 
WHERE 
  key_id = 'c55b7806bc3ad8930bcaf66d3474cc54a6c7973717ce30f73f1b3f95e9e1bf94' 
  AND (
    token = 'P3Z5c7+oIoGaJXCtcrrQiPRcy1qTA5UtPTTEAn7CIQs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027