UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vacl4hRaAG998Uzq3w1H4DHNLQiD18Ap75omhRXLkDI=' 
WHERE 
  key_id = '3f377ed00da28a5204a2478a0a6e2e402ba473e1f0ee8dd3b7894444df08dcd3' 
  AND (
    token = 'Vacl4hRaAG998Uzq3w1H4DHNLQiD18Ap75omhRXLkDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055