UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EvmJZ6EetCy7oraKD6ybbyKRRkrobBQZNdCgaYVIv/k=' 
WHERE 
  key_id = 'ff7ae894faeb43e1a6461cfee9067b98bd4a88e996e0fa77036b7db21bd7a5b8' 
  AND (
    token = 'EvmJZ6EetCy7oraKD6ybbyKRRkrobBQZNdCgaYVIv/k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00084